package org.example.domain.user_raffle.model.event.publisher;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author lxc18
 * @date 2025/4/2 10:47
 * @description StockZeroPublisher
 */
@Component
public class RabbitMQPublisher<T> {

    @Resource
    private RabbitTemplate rabbitTemplate;

    public void publish(String topic,T data) {
        rabbitTemplate.convertAndSend(topic,data);
    }
}
